Bug 566532 – GtkScaleButton implementation of GtkOrientable
authorChristian Dywan <christian@imendio.com>
Tue, 13 Jan 2009 15:24:03 +0000 (15:24 +0000)
committerChristian Dywan <cdywan@src.gnome.org>
Tue, 13 Jan 2009 15:24:03 +0000 (15:24 +0000)
2009-01-13  Christian Dywan  <christian@imendio.com>

Bug 566532 – GtkScaleButton implementation of GtkOrientable

* gtk/gtk.symbols:
* gtk/gtkscalebutton.c (gtk_scale_button_class_init),
(gtk_scale_button_set_property):
* gtk/gtkscalebutton.h: Deprecate gtk_scale_button_get_orientation
        in favour of implementing GtkOrientable. Patch by Bruce Cowan.

svn path=/trunk/; revision=22112

ChangeLog
gtk/gtk.symbols
gtk/gtkscalebutton.c
gtk/gtkscalebutton.h

index 4f49b9ddd100c1c94af1d07d21b96a445c4dc9f5..560992980e000ad27a515860c0773f0f32c06d03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-13  Christian Dywan  <christian@imendio.com>
+
+       Bug 566532 – GtkScaleButton implementation of GtkOrientable
+
+       * gtk/gtk.symbols:
+       * gtk/gtkscalebutton.c (gtk_scale_button_class_init),
+       (gtk_scale_button_set_property):
+       * gtk/gtkscalebutton.h: Deprecate gtk_scale_button_get_orientation
+        in favour of implementing GtkOrientable. Patch by Bruce Cowan.
+
 2009-01-13  Tor Lillqvist  <tml@iki.fi>
 
        Bug 164002 - query scripts don't work uninstalled on windows
index 79b6b363a4f1ef617222c5828688fc6bdb4faadf..029b6136e5535c0e64742caefccc566e6c6567d8 100644 (file)
@@ -3469,8 +3469,10 @@ gtk_scale_button_set_icons
 gtk_scale_button_set_value
 gtk_scale_button_get_adjustment
 gtk_scale_button_set_adjustment
+#ifndef GTK_DISABLE_DEPRECATED
 gtk_scale_button_get_orientation
 gtk_scale_button_set_orientation
+#endif
 gtk_scale_button_get_plus_button
 gtk_scale_button_get_minus_button
 gtk_scale_button_get_popup
index b6933bc23cec0ff5667b537211bbc8337317a4cc..32a70e19844d14a0ffd703b023bba726a6f16919 100644 (file)
@@ -51,6 +51,7 @@
 #include "gtkhscale.h"
 #include "gtkvscale.h"
 #include "gtkframe.h"
+#include "gtkorientable.h"
 #include "gtkhbox.h"
 #include "gtkvbox.h"
 #include "gtkwindow.h"
@@ -156,9 +157,11 @@ static void gtk_scale_button_scale_value_changed(GtkRange            *range);
 /* see below for scale definitions */
 static GtkWidget *gtk_scale_button_scale_box_new(GtkScaleButton      *button);
 
-static guint signals[LAST_SIGNAL] = { 0, };
+G_DEFINE_TYPE_WITH_CODE (GtkScaleButton, gtk_scale_button, GTK_TYPE_BUTTON,
+                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
+                                                NULL))
 
-G_DEFINE_TYPE (GtkScaleButton, gtk_scale_button, GTK_TYPE_BUTTON)
+static guint signals[LAST_SIGNAL] = { 0, };
 
 static void
 gtk_scale_button_class_init (GtkScaleButtonClass *klass)
@@ -187,14 +190,9 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass)
    *
    * Since: 2.14
    **/
-  g_object_class_install_property (gobject_class,
-                                  PROP_ORIENTATION,
-                                  g_param_spec_enum ("orientation",
-                                                      P_("Orientation"),
-                                                      P_("The orientation of the scale"),
-                                                      GTK_TYPE_ORIENTATION,
-                                                      GTK_ORIENTATION_VERTICAL,
-                                                      GTK_PARAM_READWRITE));
+  g_object_class_override_property (gobject_class,
+                                   PROP_ORIENTATION,
+                                   "orientation");
 
   g_object_class_install_property (gobject_class,
                                   PROP_VALUE,
@@ -426,7 +424,7 @@ gtk_scale_button_set_property (GObject       *object,
   switch (prop_id)
     {
     case PROP_ORIENTATION:
-      gtk_scale_button_set_orientation (button, g_value_get_enum (value));
+      gtk_orientable_set_orientation (GTK_ORIENTABLE (button), g_value_get_enum (value));
       break;
     case PROP_VALUE:
       gtk_scale_button_set_value (button, g_value_get_double (value));
@@ -705,6 +703,8 @@ gtk_scale_button_set_adjustment     (GtkScaleButton *button,
  * Returns: the #GtkScaleButton's orientation.
  *
  * Since: 2.14
+ *
+ * Deprecated: 2.16: Use gtk_orientable_get_orientation() instead.
  **/
 GtkOrientation
 gtk_scale_button_get_orientation (GtkScaleButton *button)
@@ -722,6 +722,8 @@ gtk_scale_button_get_orientation (GtkScaleButton *button)
  * Sets the orientation of the #GtkScaleButton's popup window.
  *
  * Since: 2.14
+ *
+ * Deprecated: 2.16: Use gtk_orientable_set_orientation() instead.
  **/
 void
 gtk_scale_button_set_orientation (GtkScaleButton *button,
index ec6baf0402f7c53f732b0cb7179d6673efdefdca..61239098db41a23b9298450960d0d5c69bedf3b4 100644 (file)
@@ -95,13 +95,18 @@ void             gtk_scale_button_set_value        (GtkScaleButton  *button,
 GtkAdjustment *  gtk_scale_button_get_adjustment   (GtkScaleButton  *button);
 void             gtk_scale_button_set_adjustment   (GtkScaleButton  *button,
                                                     GtkAdjustment   *adjustment);
-GtkOrientation   gtk_scale_button_get_orientation  (GtkScaleButton  *button);
-void             gtk_scale_button_set_orientation  (GtkScaleButton  *button,
-                                                    GtkOrientation   orientation);
 GtkWidget *      gtk_scale_button_get_plus_button  (GtkScaleButton  *button);
 GtkWidget *      gtk_scale_button_get_minus_button (GtkScaleButton  *button);
 GtkWidget *      gtk_scale_button_get_popup        (GtkScaleButton  *button);
 
+#ifndef GTK_DISABLE_DEPRECATED
+
+GtkOrientation   gtk_scale_button_get_orientation  (GtkScaleButton  *button);
+void             gtk_scale_button_set_orientation  (GtkScaleButton  *button,
+                                                    GtkOrientation   orientation);
+
+#endif /* GTK_DISABLE_DEPRECATED */
+
 G_END_DECLS
 
 #endif /* __GTK_SCALE_BUTTON_H__ */